<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>表单添加编辑渲染</title>
        <{$showjs}>
        <link rel="stylesheet" type="text/css" href="../css/main.css" />
        <{section name=li loop=$plugcss}>
        <link rel="stylesheet" type="text/css" href="<{$plugcss[li]}>" />
        <{/section}>
        <{section name=li loop=$plugurl}>
        <script type="text/javascript" src="<{$plugurl[li]}>"></script>
        <{/section}>
        <script type="text/javascript" src="/Plug-in/My97/WdatePicker.js"></script>

        <script type="text/javascript" src="/Plug-in/My97/WdatePicker.js"></script>
        <script type="text/javascript" src="/Plug-in/ext/colorpicker/colorpicker.js"></script>
        <script type="text/javascript" src="/Plug-in/ext/colorpicker/colorpickerfield.js"></script>
        <link rel="stylesheet" type="text/css" href="/Plug-in/ext/colorpicker/colorpicker.css" />
        <style type="text/css">
            .x-date-menu > ul{
                display: inline;
            }
            .x-date-menu > ul li{
                display: inline;
            }
            .hang {
                background: #D1DDEF;
                border-top:1px dotted #B5B8C8;
                border-bottom:1px dotted #B5B8C8;
            }

        </style>
        <script language="javascript">
            Ext.onReady(function(){

                Ext.QuickTips.init();
    
                // turn on validation errors beside the field globally
                Ext.form.Field.prototype.msgTarget = 'side';

                var form = new Ext.FormPanel({
                    frame: true,
                    labelWidth: 110,
                    width: 700,
                    renderTo:'form-ct',
                    autoScroll:true,
                    fileUpload: true,
                    bodyStyle: 'padding:0 10px 0;',
        
                    items: [            {
                            xtype:'hidden',
                            name: 'id',
                            id:'id',
                            value:'<{$id}>'
                        },{
                            xtype:'hidden',
                            name: 'tid',
                            value:'<{$tid}>'
                        },{
                            xtype:'hidden',
                            name: 'bdtid',
                            value:'<{$bdtid}>'
                        },{
                            xtype:'hidden',
                            name: 'bdid',
                            value:'<{$bdid}>'
                        },{
                            xtype:'hidden',
                            name: 'gid',
                            value:'<{$gid}>'
                        },{
                            xtype:'hidden',
                            name: 'lg',
                            value:'<{$lg}>'
                        },
                            <{$fcf}>],
        
                    buttons: [{
                            xtype:'button',
                            text: '保存',
                            handler:function (){
                                if(form.form.isValid()){
                                        <{$fckplugin}>
                                        form.form.doAction('submit',{
                                        url:'<{$thisurl}>',
                                        method:'POST',
                                        params:{op:'save'},
                                        waitMsg:'正在提交....',
                                        success:function(form,action){
                                            if (action.result.msg=='ok') {
                                                n=parent.tabs.getActiveTab();
                                                parent.tabs.remove(n);
                                            } else {
                                                Ext.Msg.alert('提示',unescape(action.result.msg));
                                            }
                                        }
                                        ,
                                        //提交失败的回调函数
                                        failure:function(form,action){
                                            if(action==''){
                                                Ext.Msg.alert('错误','数据提交错误！');}
                                            else{
                                                Ext.Msg.alert('提示',action.result.msg);
                                            }
                                        }
                                    })};
                            }
                        },{
                            xtype:'button',
                            text: '取消',
                            handler:function (){	form.form.reset();
                            }
                        }]
                });
                    <{section name=li loop=$plugjs}>
                    <{$plugjs[li]}>
                    <{/section}>

                });
            function qkzd(id,zd){
                Ext.Msg.confirm('提示','你真的要清空此附件？',function(a){
                    if(a=='yes'){
														
                        Ext.Ajax.request({
                            waitMsg:'数据处理中...',
                            url:'./index.php',
                            method:'POST',
                            params:{
                                op:'qkzd',
                                id:id,
                                tname:'<{$tname}>',
                                zd:zd
                            },
                            success:function(response){
                                location.reload();
                            },
                            failure:function(response){
                                Ext.MessageBox.alert('警告',"无法连接数据库!");
                            }
												
                        });
                    }
                });
            }

        </script>
    </head>
    <body>
        <div id="form-ct"></div>

    </body>
</html>